Optimal. Leaf size=59 \[ -\frac {(2 a+3 b) x}{2 b^2}+\frac {(a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} b^2}-\frac {\cos (x) \sin (x)}{2 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3270, 425, 536,
209, 211} \begin {gather*} \frac {(a+b)^{3/2} \text {ArcTan}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} b^2}-\frac {x (2 a+3 b)}{2 b^2}-\frac {\sin (x) \cos (x)}{2 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 211
Rule 425
Rule 536
Rule 3270
Rubi steps
\begin {align*} \int \frac {\cos ^4(x)}{a+b \sin ^2(x)} \, dx &=\text {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2 \left (a+(a+b) x^2\right )} \, dx,x,\tan (x)\right )\\ &=-\frac {\cos (x) \sin (x)}{2 b}+\frac {\text {Subst}\left (\int \frac {a+2 b+(-a-b) x^2}{\left (1+x^2\right ) \left (a+(a+b) x^2\right )} \, dx,x,\tan (x)\right )}{2 b}\\ &=-\frac {\cos (x) \sin (x)}{2 b}+\frac {(a+b)^2 \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\tan (x)\right )}{b^2}-\frac {(2 a+3 b) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (x)\right )}{2 b^2}\\ &=-\frac {(2 a+3 b) x}{2 b^2}+\frac {(a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} b^2}-\frac {\cos (x) \sin (x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 55, normalized size = 0.93 \begin {gather*} \frac {\frac {4 (a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a}}-2 (2 a x+3 b x+b \cos (x) \sin (x))}{4 b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.26, size = 63, normalized size = 1.07
method | result | size |
default | \(-\frac {\frac {b \tan \left (x \right )}{2 \left (\tan ^{2}\left (x \right )\right )+2}+\frac {\left (2 a +3 b \right ) \arctan \left (\tan \left (x \right )\right )}{2}}{b^{2}}+\frac {\left (a +b \right )^{2} \arctan \left (\frac {\left (a +b \right ) \tan \left (x \right )}{\sqrt {a \left (a +b \right )}}\right )}{b^{2} \sqrt {a \left (a +b \right )}}\) | \(63\) |
risch | \(-\frac {a x}{b^{2}}-\frac {3 x}{2 b}+\frac {i {\mathrm e}^{2 i x}}{8 b}-\frac {i {\mathrm e}^{-2 i x}}{8 b}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{2 b^{2}}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{2 a b}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{2 b^{2}}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{2 a b}\) | \(209\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 64, normalized size = 1.08 \begin {gather*} -\frac {{\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}} - \frac {\tan \left (x\right )}{2 \, {\left (b \tan \left (x\right )^{2} + b\right )}} + \frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} b^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 239, normalized size = 4.05 \begin {gather*} \left [-\frac {2 \, b \cos \left (x\right ) \sin \left (x\right ) - {\left (a + b\right )} \sqrt {-\frac {a + b}{a}} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (x\right )^{2} - 4 \, {\left ({\left (2 \, a^{2} + a b\right )} \cos \left (x\right )^{3} - {\left (a^{2} + a b\right )} \cos \left (x\right )\right )} \sqrt {-\frac {a + b}{a}} \sin \left (x\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (x\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) + 2 \, {\left (2 \, a + 3 \, b\right )} x}{4 \, b^{2}}, -\frac {b \cos \left (x\right ) \sin \left (x\right ) + {\left (a + b\right )} \sqrt {\frac {a + b}{a}} \arctan \left (\frac {{\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a - b\right )} \sqrt {\frac {a + b}{a}}}{2 \, {\left (a + b\right )} \cos \left (x\right ) \sin \left (x\right )}\right ) + {\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.46, size = 92, normalized size = 1.56 \begin {gather*} -\frac {{\left (2 \, a + 3 \, b\right )} x}{2 \, b^{2}} + \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (x\right ) + b \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} {\left (a^{2} + 2 \, a b + b^{2}\right )}}{\sqrt {a^{2} + a b} b^{2}} - \frac {\tan \left (x\right )}{2 \, {\left (\tan \left (x\right )^{2} + 1\right )} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 14.67, size = 119, normalized size = 2.02 \begin {gather*} -\frac {3\,\mathrm {atan}\left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right )}{2\,b}-\frac {a\,\mathrm {atan}\left (\frac {\sin \left (x\right )}{\cos \left (x\right )}\right )}{b^2}-\frac {\cos \left (x\right )\,\sin \left (x\right )}{2\,b}-\frac {\mathrm {atanh}\left (\frac {\sin \left (x\right )\,\sqrt {-a^4-3\,a^3\,b-3\,a^2\,b^2-a\,b^3}}{\cos \left (x\right )\,a^2+b\,\cos \left (x\right )\,a}\right )\,\sqrt {-a^4-3\,a^3\,b-3\,a^2\,b^2-a\,b^3}}{a\,b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________